home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
cmln0886.arc
/
PROEXP2.LTG
< prev
next >
Wrap
Text File
|
1986-06-02
|
640b
|
33 lines
LISTING 2.
Cash Register Queueing
-- FREQ = average frequency of arrivals
-- CHECK-OUT = time required for average check-out
-- LINE = length of line of customers
-- F_C = counter for frequency of arrivalsè-- C_C = counter for check-outs
BEGIN
INITIALIZE
Read from keyboard: FREQ, CHECK-OUT
LINE = 0
F_C = 0
C_C = 0
LOOP
WHILE no keypress
F_C = F_C + 1
IF F_C >= FREQ
THEN
LINE = LINE + 1
F_C = 0
C_C = C_C + 1
IF C_C >= CHECK-OUT
THEN
C_C = 0
IF LINE > 0
THEN LINE = LINE -1
Display LINE
Check for keypress
END LOOP
END